package com.qch.service.impl;

import com.qch.service.WorkService;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;

/**
 * @Author qch
 * @Date 2021/2/19
 */
@Service
public class WorkServiceImpl implements WorkService {
    @Override
    public String methodA(String message, int timeToWait) {
        Random rd = new Random();
        int i = rd.nextInt(100);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return message;

    }

    @Override
    public String methodB(String message, int timeToWait) {
        Random rd = new Random();
        int i = rd.nextInt(100);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return message;
    }

    @Override
    public String methodC(String message, int timeToWait) {
        Random rd = new Random();
        int i = rd.nextInt(100);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return message;
    }
}
